<template>
	<view class="shop-list panel pannel_stb" :style="'margin-top: ' + (isFixedTop ? 30 : 0) + 'rpx;'">
		<block v-for="(item, index) in goodsList" :key="index">
			<view class="shop-one">
				<view class="hd_label" v-if="item.IsImportant">
					<image src="/static/img/hdsj.png" style="height: 100%" mode="heightFix"></image>
				</view>
				<view class="name_icon" v-if="item.renzheng">
					<image src="/static/img/jinpai.png" style="margin-right: 4rpx; height: 100%" mode="heightFix">
					</image>
				</view>
				<view class="flex-row" @tap="gocompanydetail" :data-id="item.ShopId" :data-distance="item.distance">
					<view class="flex-grow-0 flex-y-center vipbg">
						<image :src="$com.imageOSS(item.picurl) + '?x-oss-process=image/resize,m_fill,h_200,w_200'"
							:style="'width:200rpx;height:200rpx;border-radius:' + (item.VIP > 0 ? 36 : 10) + 'rpx;'">
						</image>
						<image src="/static/img/vip-bg.png"
							style="position: absolute; z-index: 1; width: 200rpx; height: 200rpx" v-if="item.VIP > 0">
						</image>
					</view>
					<view class="w-100 flex-grow-1 content_shop" style="margin-left: 20rpx">
						<view class="flex-row shop_name_b">
							<view class="flex-grow-0" v-if="item.VIP > 0">
								<image src="/static/img/svip.png" style="margin-right: 10rpx; height: 100%"
									mode="heightFix"></image>
							</view>
							<view class="text-more shop_name"
								:style="'color:#353535; width: ' + (item.IsImportant ? '65%' : '80%') + ';'">
								{{ item.ShopName }}
							</view>
						</view>
						<view v-if="item.shouquan" class="shouquan_tag">
							<image :src='$com.imageOSS("xuqiu/m17413377050005441.png")' style='height:100%;width: 100%;' mode="widthFix"></image>
						</view>
						<view v-if="item.parent" class="fs-sm flex-row list-mt-10">所属公司：{{ item.parent }}</view>
						<view class="shop_address_jl list-mt-10">
							<view class="shop_address ellipsis">
								<van-icon name="location" size="14px" />
								{{ item.Address2 + (item.Address != 'null' ? item.Address : '') }}
							</view>
							<view class="shop_juli ellipsis">距离：{{ $com.toFixKM(item.distance) }}</view>
						</view>
						<view class="fs-sm flex-row list-mt-10 label_box">
							<view class="name_label label_rx" style="background-color: #fdf3e4; color: #b89d76"
								v-if="item.rexiaobang">
								<view class="label_rx_top">TOP</view>
								{{ item.city }}热销前{{ item.rexiaobang == 1 ? '10' : '100' }}名
							</view>
							<view class="name_label" style="background-color: #edf4fe; color: #4d84d0"
								v-if="item.zhiming">全国知名品牌</view>
							<view class="name_label" style="background-color: #fdf2e4; color: #e37929"
								v-if="item.renzheng">
								<text>平台认证</text>
							</view>
						</view>
						<view class="fs-sm flex-row list-mt-10">
							<view class="eye_ll">
								<view v-if="item.Category && item.Category != 'null'" class="label_lei">
									{{ item.Category != null && item.Category != 'null' ? item.Category + '类' : '' }}
								</view>
								<van-icon name="eye" size="16px" color="#999" />
								<view style="margin-left: 4rpx">{{ item.baoguang }}人</view>
							</view>
						</view>
						<view class="shop_star" @tap.stop.prevent="followClick" :data-item="item">
							<text class="shop_star_t"
								:style="'color:' + (item.isfav ? '#fbbd08' : '#cccccc')">{{ item.isfav ? '' : '收藏' }}</text>
							<van-icon name="star" :color="item.isfav ? '#fbbd08' : '#cccccc'" size="18px" />
						</view>
					</view>
				</view>
				<view v-if="item.chuchuang_list.length > 0" class="line_img"></view>
				<scroll-view v-if="item.chuchuang_list.length > 0" class="myScroll" scroll-x lower-threshold="-50"
					@scrolltolower="handleScrolltolower">
					<block v-for="(casesItem, casesIndex) in item.chuchuang_list" :key="casesIndex">
						<view class="row" @tap="gocompanydetail" :data-id="item.ShopId" :data-distance="item.distance">
							<image
								:src="$com.imageOSS(casesItem.picurl) + '?x-oss-process=image/resize,m_fill,h_160,w_220'"
								style="margin-right: 4rpx; height: 100%" mode="aspectFill" />
							<view class="casesItem_t ellipsis">{{ casesItem.title }}</view>
						</view>
					</block>
				</scroll-view>
			</view>
		</block>

	</view>
</template>
<script>
	export default {
		data() {
			return {
				isShow: false,
				casesIndex: 0,

				casesItem: {
					title: ''
				},

				data: '',
				loadmore: '',
				loaddone: '',
				abnor: ''
			};
		},
		/**
		 * 组件的属性列表
		 */
		props: {
			goodsList: {
				type: Array,
				default: () => []
				// observer:"getBoxSize"
			},
			isFixedTop: {
				type: Boolean,
				default: false
			}
		},
		/**
		 * 组件的方法列表
		 */
		methods: {
			gocompanydetail(e) {
				const data = e.currentTarget.dataset || e.target.dataset;
				this.$emit('gocompanydetail', {
					detail: {
						data
					}
				});
			},
			followClick(e) {
				let {
					isfav,
					ShopId
				} = e.currentTarget.dataset.item;
				this.$emit('followClick', {
					detail: {
						isfav,
						ShopId
					}
				});
			},
			handleScrolltolower(e) {
				console.log('滚动----', e);
				this.isShow = true;
			}
		},
		created: function() {}
	};
</script>
<style>
	@import './my-goods-list.css';
</style>
